package com.cy.springcloud.controllers;

import com.cy.springcloud.services.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 使用springcloud feign调用远程服务方法
 * @ClassName: feignController
 * @Author: chenyu
 * @Date: 2025/1/7 11:18
 */
@RestController
public class feignController {

    @Autowired
    private HelloService helloService;

    @RequestMapping("/feign/hello")
    public String hello() {
        //调用声明式的接口方法，实现对远程服务的调用
        return helloService.hello();
    }
}
